home *** CD-ROM | disk | FTP | other *** search
/ Apple Chronicle / Apple Chronicle (CDWM1023150)(Apple Computer)(1992).iso / Home / Home / background_2717.xml < prev    next >
Extensible Markup Language  |  1992-08-27  |  27KB  |  369 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE background PUBLIC "-//Apple, Inc.//DTD background V 2.0//EN" "" >
  3. <background>
  4.     <id>2717</id>
  5.     <filler1>0</filler1>
  6.     <bitmap>BMAP_19890.pbm</bitmap>
  7.     <cantDelete> <true /> </cantDelete>
  8.     <showPict> <true /> </showPict>
  9.     <dontSearch> <false /> </dontSearch>
  10.     <link rel="stylesheet" type="text/css" href="stylesheet_4802.css" />
  11.     <part>
  12.         <id>68</id>
  13.         <type>button</type>
  14.         <visible> <true /> </visible>
  15.         <reserved5> 0 </reserved5>
  16.         <reserved4> 0 </reserved4>
  17.         <reserved3> 0 </reserved3>
  18.         <reserved2> 0 </reserved2>
  19.         <reserved1> 0 </reserved1>
  20.         <enabled> <true /> </enabled>
  21.         <rect>
  22.             <left>35</left>
  23.             <top>307</top>
  24.             <right>118</right>
  25.             <bottom>328</bottom>
  26.         </rect>
  27.         <style>transparent</style>
  28.         <showName> <true /> </showName>
  29.         <highlight> <false /> </highlight>
  30.         <autoHighlight> <false /> </autoHighlight>
  31.         <sharedHighlight> <false /> </sharedHighlight>
  32.         <family>0</family>
  33.         <titleWidth>0</titleWidth>
  34.         <icon>0</icon>
  35.         <textAlign>center</textAlign>
  36.         <font>Geneva</font>
  37.         <textSize>10</textSize>
  38.         <textStyle>plain</textStyle>
  39.         <name>Welcome to...</name>
  40.         <script>on mouseUpgo card (the short name of me)end mouseUp</script>
  41.     </part>
  42.     <part>
  43.         <id>3</id>
  44.         <type>button</type>
  45.         <visible> <true /> </visible>
  46.         <reserved5> 0 </reserved5>
  47.         <reserved4> 0 </reserved4>
  48.         <reserved3> 0 </reserved3>
  49.         <reserved2> 0 </reserved2>
  50.         <reserved1> 0 </reserved1>
  51.         <enabled> <true /> </enabled>
  52.         <rect>
  53.             <left>125</left>
  54.             <top>307</top>
  55.             <right>208</right>
  56.             <bottom>328</bottom>
  57.         </rect>
  58.         <style>transparent</style>
  59.         <showName> <true /> </showName>
  60.         <highlight> <false /> </highlight>
  61.         <autoHighlight> <false /> </autoHighlight>
  62.         <sharedHighlight> <false /> </sharedHighlight>
  63.         <family>0</family>
  64.         <titleWidth>0</titleWidth>
  65.         <icon>0</icon>
  66.         <textAlign>center</textAlign>
  67.         <font>Geneva</font>
  68.         <textSize>10</textSize>
  69.         <textStyle>plain</textStyle>
  70.         <name>Stack Kit</name>
  71.         <script>on mouseUpgo card (the short name of me)end mouseUp</script>
  72.     </part>
  73.     <part>
  74.         <id>2</id>
  75.         <type>button</type>
  76.         <visible> <true /> </visible>
  77.         <reserved5> 0 </reserved5>
  78.         <reserved4> 0 </reserved4>
  79.         <reserved3> 0 </reserved3>
  80.         <reserved2> 0 </reserved2>
  81.         <reserved1> 0 </reserved1>
  82.         <enabled> <true /> </enabled>
  83.         <rect>
  84.             <left>215</left>
  85.             <top>307</top>
  86.             <right>298</right>
  87.             <bottom>328</bottom>
  88.         </rect>
  89.         <style>transparent</style>
  90.         <showName> <true /> </showName>
  91.         <highlight> <false /> </highlight>
  92.         <autoHighlight> <false /> </autoHighlight>
  93.         <sharedHighlight> <false /> </sharedHighlight>
  94.         <family>0</family>
  95.         <titleWidth>0</titleWidth>
  96.         <icon>0</icon>
  97.         <textAlign>center</textAlign>
  98.         <font>Geneva</font>
  99.         <textSize>10</textSize>
  100.         <textStyle>plain</textStyle>
  101.         <name>Card 3</name>
  102.         <script>on mouseUpgo card (the short name of me)end mouseUp</script>
  103.     </part>
  104.     <part>
  105.         <id>7</id>
  106.         <type>field</type>
  107.         <visible> <true /> </visible>
  108.         <dontWrap> <false /> </dontWrap>
  109.         <dontSearch> <false /> </dontSearch>
  110.         <sharedText> <false /> </sharedText>
  111.         <fixedLineHeight> <true /> </fixedLineHeight>
  112.         <autoTab> <false /> </autoTab>
  113.         <lockText> <true /> </lockText>
  114.         <rect>
  115.             <left>16</left>
  116.             <top>37</top>
  117.             <right>397</right>
  118.             <bottom>69</bottom>
  119.         </rect>
  120.         <style>transparent</style>
  121.         <autoSelect> <false /> </autoSelect>
  122.         <showLines> <false /> </showLines>
  123.         <wideMargins> <true /> </wideMargins>
  124.         <multipleLines> <false /> </multipleLines>
  125.         <reservedFamily> 0 </reservedFamily>
  126.         <titleWidth>0</titleWidth>
  127.         <icon>0</icon>
  128.         <textAlign>left</textAlign>
  129.         <font>Palatino</font>
  130.         <textSize>18</textSize>
  131.         <textStyle>plain</textStyle>
  132.         <textHeight>24</textHeight>
  133.         <name>card title</name>
  134.         <script></script>
  135.     </part>
  136.     <part>
  137.         <id>107</id>
  138.         <type>button</type>
  139.         <visible> <true /> </visible>
  140.         <reserved5> 0 </reserved5>
  141.         <reserved4> 0 </reserved4>
  142.         <reserved3> 0 </reserved3>
  143.         <reserved2> 0 </reserved2>
  144.         <reserved1> 0 </reserved1>
  145.         <enabled> <true /> </enabled>
  146.         <rect>
  147.             <left>305</left>
  148.             <top>307</top>
  149.             <right>388</right>
  150.             <bottom>328</bottom>
  151.         </rect>
  152.         <style>transparent</style>
  153.         <showName> <true /> </showName>
  154.         <highlight> <false /> </highlight>
  155.         <autoHighlight> <false /> </autoHighlight>
  156.         <sharedHighlight> <false /> </sharedHighlight>
  157.         <family>0</family>
  158.         <titleWidth>0</titleWidth>
  159.         <icon>0</icon>
  160.         <textAlign>center</textAlign>
  161.         <font>Geneva</font>
  162.         <textSize>10</textSize>
  163.         <textStyle>plain</textStyle>
  164.         <name>Card 4</name>
  165.         <script>on mouseUpgo card (the short name of me)end mouseUp</script>
  166.     </part>
  167.     <part>
  168.         <id>149</id>
  169.         <type>button</type>
  170.         <visible> <true /> </visible>
  171.         <reserved5> 0 </reserved5>
  172.         <reserved4> 0 </reserved4>
  173.         <reserved3> 0 </reserved3>
  174.         <reserved2> 0 </reserved2>
  175.         <reserved1> 0 </reserved1>
  176.         <enabled> <true /> </enabled>
  177.         <rect>
  178.             <left>395</left>
  179.             <top>307</top>
  180.             <right>478</right>
  181.             <bottom>328</bottom>
  182.         </rect>
  183.         <style>transparent</style>
  184.         <showName> <true /> </showName>
  185.         <highlight> <false /> </highlight>
  186.         <autoHighlight> <false /> </autoHighlight>
  187.         <sharedHighlight> <false /> </sharedHighlight>
  188.         <family>0</family>
  189.         <titleWidth>0</titleWidth>
  190.         <icon>0</icon>
  191.         <textAlign>center</textAlign>
  192.         <font>Geneva</font>
  193.         <textSize>10</textSize>
  194.         <textStyle>plain</textStyle>
  195.         <name>Card 5</name>
  196.         <script>on mouseUpgo card (the short name of me)end mouseUp</script>
  197.     </part>
  198.     <part>
  199.         <id>168</id>
  200.         <type>field</type>
  201.         <visible> <true /> </visible>
  202.         <dontWrap> <false /> </dontWrap>
  203.         <dontSearch> <false /> </dontSearch>
  204.         <sharedText> <true /> </sharedText>
  205.         <fixedLineHeight> <true /> </fixedLineHeight>
  206.         <autoTab> <false /> </autoTab>
  207.         <lockText> <true /> </lockText>
  208.         <rect>
  209.             <left>397</left>
  210.             <top>35</top>
  211.             <right>494</right>
  212.             <bottom>67</bottom>
  213.         </rect>
  214.         <style>transparent</style>
  215.         <autoSelect> <false /> </autoSelect>
  216.         <showLines> <false /> </showLines>
  217.         <wideMargins> <false /> </wideMargins>
  218.         <multipleLines> <false /> </multipleLines>
  219.         <reservedFamily> 0 </reservedFamily>
  220.         <titleWidth>0</titleWidth>
  221.         <icon>0</icon>
  222.         <textAlign>left</textAlign>
  223.         <font>Palatino</font>
  224.         <textSize>24</textSize>
  225.         <textStyle>plain</textStyle>
  226.         <textHeight>32</textHeight>
  227.         <name>Home</name>
  228.         <script></script>
  229.     </part>
  230.     <part>
  231.         <id>169</id>
  232.         <type>button</type>
  233.         <visible> <true /> </visible>
  234.         <reserved5> 0 </reserved5>
  235.         <reserved4> 0 </reserved4>
  236.         <reserved3> 0 </reserved3>
  237.         <reserved2> 0 </reserved2>
  238.         <reserved1> 0 </reserved1>
  239.         <enabled> <true /> </enabled>
  240.         <rect>
  241.             <left>11</left>
  242.             <top>304</top>
  243.             <right>31</right>
  244.             <bottom>334</bottom>
  245.         </rect>
  246.         <style>transparent</style>
  247.         <showName> <false /> </showName>
  248.         <highlight> <false /> </highlight>
  249.         <autoHighlight> <true /> </autoHighlight>
  250.         <sharedHighlight> <true /> </sharedHighlight>
  251.         <family>0</family>
  252.         <titleWidth>0</titleWidth>
  253.         <icon>28810</icon>
  254.         <textAlign>center</textAlign>
  255.         <font>Chicago</font>
  256.         <textSize>12</textSize>
  257.         <textStyle>plain</textStyle>
  258.         <name>left arrow</name>
  259.         <script>on mouseUpvisual effect wipe rightgo prev cardend mouseUp</script>
  260.     </part>
  261.     <part>
  262.         <id>170</id>
  263.         <type>button</type>
  264.         <visible> <true /> </visible>
  265.         <reserved5> 0 </reserved5>
  266.         <reserved4> 0 </reserved4>
  267.         <reserved3> 0 </reserved3>
  268.         <reserved2> 0 </reserved2>
  269.         <reserved1> 0 </reserved1>
  270.         <enabled> <true /> </enabled>
  271.         <rect>
  272.             <left>480</left>
  273.             <top>304</top>
  274.             <right>501</right>
  275.             <bottom>334</bottom>
  276.         </rect>
  277.         <style>transparent</style>
  278.         <showName> <false /> </showName>
  279.         <highlight> <false /> </highlight>
  280.         <autoHighlight> <true /> </autoHighlight>
  281.         <sharedHighlight> <true /> </sharedHighlight>
  282.         <family>0</family>
  283.         <titleWidth>0</titleWidth>
  284.         <icon>28811</icon>
  285.         <textAlign>center</textAlign>
  286.         <font>Chicago</font>
  287.         <textSize>12</textSize>
  288.         <textStyle>plain</textStyle>
  289.         <name>right arrow</name>
  290.         <script>on mouseUpvisual effect wipe leftif the commandKey is down then go last cardelse go next cardend mouseUp</script>
  291.     </part>
  292.     <part>
  293.         <id>177</id>
  294.         <type>field</type>
  295.         <visible> <true /> </visible>
  296.         <dontWrap> <false /> </dontWrap>
  297.         <dontSearch> <false /> </dontSearch>
  298.         <sharedText> <true /> </sharedText>
  299.         <fixedLineHeight> <true /> </fixedLineHeight>
  300.         <autoTab> <false /> </autoTab>
  301.         <lockText> <true /> </lockText>
  302.         <rect>
  303.             <left>346</left>
  304.             <top>71</top>
  305.             <right>500</right>
  306.             <bottom>97</bottom>
  307.         </rect>
  308.         <style>transparent</style>
  309.         <autoSelect> <false /> </autoSelect>
  310.         <showLines> <false /> </showLines>
  311.         <wideMargins> <false /> </wideMargins>
  312.         <multipleLines> <false /> </multipleLines>
  313.         <reservedFamily> 0 </reservedFamily>
  314.         <titleWidth>0</titleWidth>
  315.         <icon>0</icon>
  316.         <textAlign>center</textAlign>
  317.         <font>Geneva</font>
  318.         <textSize>9</textSize>
  319.         <textStyle>plain</textStyle>
  320.         <textHeight>12</textHeight>
  321.         <name>Copyright</name>
  322.         <script>on mouseUpif there is a card field "TeamInfo"then show card field id 261end mouseUp</script>
  323.     </part>
  324.     <part>
  325.         <id>178</id>
  326.         <type>field</type>
  327.         <visible> <false /> </visible>
  328.         <dontWrap> <false /> </dontWrap>
  329.         <dontSearch> <false /> </dontSearch>
  330.         <sharedText> <false /> </sharedText>
  331.         <fixedLineHeight> <false /> </fixedLineHeight>
  332.         <autoTab> <false /> </autoTab>
  333.         <lockText> <false /> </lockText>
  334.         <rect>
  335.             <left>488</left>
  336.             <top>282</top>
  337.             <right>503</right>
  338.             <bottom>299</bottom>
  339.         </rect>
  340.         <style>rectangle</style>
  341.         <autoSelect> <false /> </autoSelect>
  342.         <showLines> <false /> </showLines>
  343.         <wideMargins> <false /> </wideMargins>
  344.         <multipleLines> <false /> </multipleLines>
  345.         <reservedFamily> 0 </reservedFamily>
  346.         <titleWidth>0</titleWidth>
  347.         <icon>0</icon>
  348.         <textAlign>left</textAlign>
  349.         <font>Geneva</font>
  350.         <textSize>12</textSize>
  351.         <textStyle>plain</textStyle>
  352.         <textHeight>16</textHeight>
  353.         <name>Card Position</name>
  354.         <script></script>
  355.     </part>
  356.     <content>
  357.         <layer>background</layer>
  358.         <id>168</id>
  359.         <text>Home</text>
  360.     </content>
  361.     <content>
  362.         <layer>background</layer>
  363.         <id>177</id>
  364.         <text>¬©1990 Apple Computer, Inc.All Rights Reserved</text>
  365.     </content>
  366.     <name>Home Cards</name>
  367.     <script>‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àûScript from stack: HomeTHE MESSAGE HANDLERS IN THIS SCRIPT:openStack,closeStack,openBackground,closeBackground,suspendStack,resumeStack,updateHomeMenu,newCard,deleteCard,renameCard,setCardNamerenumberCards,reorderCards,adjustNavHilites,newLink,makeNewHCButtondragHCButton,updateHCPathsTHE FUNCTION HANDLERS IN THIS SCRIPT:chopStr,selectHCFile,getHCPathName,memErrorScript,writeHCScriptstringIsInContainer‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû-----  Open/Resume Scripts  ----------------------------------------on openStackglobal WhichHomeCardshow menubar -- needed for the "Home" menuif WhichHomeCard is not empty then go to card WhichHomeCard-- remove any similar menusif there is a menu "Home" then delete menu "Home" -- ‚àÜpass openStack -- so others can use itend openStackon closeStackif "Home" is in the menus and (the short name of this stack is "Home")then delete menu "Home" -- ‚àÜpass closeStack -- so others can use itend closeStackon openBackground-- Requires handlers: createTheMenus,updateHomeMenu-- make the "Home" menu if necessarycreateTheMenus-- update home menu for this bkgndupdateHomeMenu truepass openBackground -- so others can use itend openBackgroundon closeBackground-- Requires handler: updateHomeMenuglobal WhichHomeCardput short name of this card into WhichHomeCard-- update home menu for this bkgndupdateHomeMenu falsepass closeBackground -- so others can use itend closeBackgroundon suspendStack-- ‚àÜ remove our custom menu when exitingif "Home" is in the menus and (the short name of this stack is "Home")then delete menu "Home" -- ‚àÜpass suspendStack -- so others can use itend suspendStackon resumeStack-- Requires handlers: createTheMenus,updateHomeMenu-- make the "Home" menu if necessarycreateTheMenus true-- update home menu for this bkgndupdateHomeMenu truepass resumeStack -- so others can use itend resumeStack-----  Menu Scripts  -----------------------------------------------on updateHomeMenu status-- update the "Home" menu for this backgroundif there is no menu "Home" then exit updateHomeMenu -- ‚àÜset checkMark of menuItem "Home Cards" of menu "Home" to status -- ‚àÜ-- enable items for this bkgnd onlyenable menuItem "Rename This Card..." of menu "Home" -- ‚àÜenable menuItem "Reorder Cards..." of menu "Home" -- ‚àÜend updateHomeMenu-----  Card Manipulation Scripts  ----------------------------------on newCard-- Requires handlers: adjustNavHilites,setUserLevelFive,restoreUserLevel-- Requires handlers: setCardName,disallowInterruption,allowInterruption-- Requires handler: renumberCards-- remember the card before the new one-- clear 'push recent card' in case the user doesn't cancelpush recent cardsetUserLevelFivedisallowInterruptionpop card into currentLocation-- name the new card and update the navigation buttonsask "Please give the new Home card a name:" -- ‚àÜif the result is "Cancel" thenset cantDelete of this card to falsedoMenu "Delete Card"go currentLocation -- returns to card last viewedexit to HyperCardend ifif it is empty then put "Untitled Card" into cardName -- ‚àÜelse put it into cardNamesetCardName cardNameput number of this card into curCardNumput number of cards in this bkgnd into numBgCardsput (numBgCards - curCardNum) into fixNumlock screenrenumberCards curCardNum,false,fixNum,1go card curCardNumunlock screenpush card -- remember where we are before adjustadjustNavHilites -- adjust the button hilightingpop card -- return to where we wererestoreUserLevelallowInterruptionpass newCardend newCardon deleteCard-- Requires handler: renumberCards,adjustNavHilites-- remember cd number to return to same position after deleteset cursor to watchput the number of this card into currentPositionlock screenput number of cards in this bkgnd into numBkgndCardsrenumberCards currentPosition,false,numBkgndCards-currentPosition,-1adjustNavHilites currentPositiongo card currentPosition -- return to where we wereunlock screenpass deleteCardend deleteCardon renameCard-- Requires handler: setCardName-- rename any of the "home" cardsask "New name for this card?" with bg field "Card Title" -- ‚àÜif it is empty or it is bg field "Card Title" or the result is "Cancel"then exit renameCardsetCardName itend renameCardon setCardName theName-- Requires handlers: disallowInterruption,allowInterruption-- Requires function handler: chopStrlock screendisallowInterruptionset name of this card to chopStr(theName,13)put theName into bg field "Card Title"put number of this card into curCardif curCard ‚⧠5 thenset name of bg btn curCard to chopStr(theName,13)set hilite of bg btn curCard to true -- make sureend ifallowInterruptionend setCardNameon renumberCards newPosition,adjustDown,fixNum,adjustput newPosition into bg fld "Card Position"if adjustDown then go card newPosition of this bkgndelse go next card of this bkgndrepeat fixNumadd adjust to bg fld "Card Position"go next card of this bkgndend repeatend renumberCardson reorderCards-- Requires handlers: disallowInterruption,allowInterruption-- Requires handlers: renumberCards,adjustNavHilities-- reorder the cards of the first bkgndput bg fld "Card Position" into currentPosition-- get new position for this card from the userask "‚Äú" & the short name of this card & "‚Äù" && ¬¨"is currently card" && currentPosition & "." & return & ¬¨"Please enter a new position for this card:" with the number of this card -- ‚àÜif (it is empty) or (it is not an integer) or (the result is "Cancel") thenbeepexit to hyperCardend ifif it > number of cards in this bkgndthen put number of cards of this bkgnd into newPositionelse put it into newPositionset cursor to watchdisallowInterruption -- adjustNavHilites cancels this-- Note: bg fld "Card Position" is a hidden fieldlock screen -- insure correct order before sortingpush card -- remember where we areif newPosition <= currentPosition thenput 1 into adjustput true into adjustDownelseput -1 into adjustput false into adjustDownend ifrenumberCards newPosition,adjustDown,abs(currentPosition - newPosition),adjustpop card -- return to where we were-- now sort them to their new positionssort cards of this bkgnd by bg fld "Card Position"adjustNavHilites -- reset navigation btns to match new card ordergo card newPositionend reorderCardson adjustNavHilites cardDeleted -- param added for delete card handler-- Requires handlers: disallowInterruption,allowInterruption-- resets bottom navigation buttons to match card orderlock ScreendisallowInterruptionrepeat with curCard = 1 to number of cards of first bgset cursor to busyif curCard = cardDeleted then next repeatgo card curCard of first bg-- unhilite navigation buttonsrepeat with curBtn = 1 to 5set hilite of bg btn curBtn to falseend repeatif ((curCard > cardDeleted) and (cardDeleted ‚↠empty)) then put 1 into adjustelse put 0 into adjustif curCard ‚⧠(5+adjust) then-- rename the buttonsset name of bg btn (curCard-adjust) of card curCard to short name of card curCard-- hilite the one for this cardset hilite of bg btn (curCard-adjust) of card curCard to trueend ifend repeatunlock screenallowInterruptionend adjustNavHilites-----  Misc Scripts  -----------------------------------------------function chopStr theStr,maxSize-- adjust any string of characters to be maxSize or fewer characters-- truncating to the nearest spaceif length(theStr) > maxSize then -- we need to chop itput char 1 to maxSize of theStr into theStr -- quick trimput length(theStr) into strSize -- so don't have to calc each timeif strSize ‚â• (maxSize-3) then -- leave room for "..."if space is in theStr then -- want to break on word boundaryrepeat with count = strSize down to 1 -- search for last spaceif char count of theStr is space and count ‚⧠(maxSize-2) thenput char 1 to (count-1) of theStr into theStrexit repeat -- we found the space so exitend ifend repeatelse put char 1 to (maxSize-3) of theStr into theStr -- need room for "..."put "..." after theStr -- to indicate the string is longerend ifend ifreturn theStrend chopStr-----  NewLink Scripts  --------------------------------------------on newLink fileType-- Requires handlers: disallowInterruption,allowInterruption-- Requires handlers: makeNewHCButton,dragHCButton,updateHCPaths-- Requires function handlers: selectHCFile,lastHCItem,getHCPathName,writeHCScript-- Allows you to select a stack, application or document from an-- answer dialog, and create a button to open that file.-- This is the main newLink handler and can be called from any stackput visible of msg box into saveVisMsgBox -- to restore it later-- if no file type is given, determine what type of file to link toif (fileType is not in "stack document application file") thenanswer "Create button linked to a stack or file?" ¬¨with "Cancel" or "File" or "Stack" -- ‚àÜif it is empty or it is "Cancel" then exit newLinkput it into fileTypeend if-- if it's a file determine what kind of file it isif fileType is "File" then -- ‚àÜanswer "Create button linked to a document or an application?" with ¬¨"Cancel" or "Document" or "Application" -- ‚àÜif it is empty or it is "Cancel" then  exit newLinkput it into fileTypeend ifdisallowInterruption-- selects the stack, application, or document to link toput "Select the" && fileType && "to open:" into prompt -- ‚àÜif fileType is "Stack" then put "STAK" into filter -- ‚àÜelse if filetype is "Application" then put "APPL" into filter -- ‚àÜelse put empty into filter -- no way to show only documentsput selectHCFile(prompt,filter) into longFileName -- full pathput lastHCItem(":",longFileName) into shortFileNameset cursor to watch-- if document is chosen, get application to open it.put empty into longAppNameif fileType is "document" then -- ‚àÜput "Select the application to open" & return ¬¨& "‚Äú" & shortFileName & "‚Äù" & ":" into prompt -- ‚àÜput selectHCFile(prompt,"APPL") into longAppName -- full pathput lastHCItem(":",longAppName) into shortAppNameend if--  extract the file path from the full path nameput getHCPathName(longFileName) into thePath--  make a new button for the linked filemakeNewHCButton shortFileName,fileType--  write the script for the new buttonset script of last cd btn to ¬¨writeHCScript(fileType,shortFileName,shortAppName)--  allow the user to set the position of the new buttonput "card button id" && id of last card button into btnIDdragHCButton btnID -- user can now move it-- update the "Paths" field on the proper "Path" cardupdateHCPaths fileType,thePathif longAppName is not empty then  --  for a document's appput getHCPathName(longAppName) into appPathupdateHCPaths "application",appPathend ifput empty into msg -- clean up and exitset visible of msg box to saveVisMsgBox -- restore itallowInterruptionend newLinkfunction selectHCFile prompt,filter-- displays dialog for selection of a particular fileTypeif filter is not empty then answer file prompt of type filterelse answer file promptif (it is empty) or (the result = "Cancel")then exit to HyperCardreturn it -- otherwise return the selected file pathend selectHCFilefunction getHCPathName longName-- Requires handler: lastHCItem-- return the path to the fileput lastHCItem(":",longName) into fileNamereturn char 1 to (length(longName) - length(fileName)) of longNameend getHCPathNameon makeNewHCButton shortName,iconType-- Requires handlers: setUserLevelFive,restoreUserLevel-- create a new button and set it's name and iconlock screensetUserLevelFive-- ‚àÜ need user level five so menu item will be theredoMenu "New Button"-- set attributes of new buttonset style of last card button to transparentset showName of last card button to trueset autoHilite of last card button to trueset name of last card button to shortNameset height of last card button to 52set icon of last card button to iconType-- don't let the button be too slimif length(shortName) * 6 > 36 thenset width of last card button to length(shortName) * 6else set width of last card button to 36choose browse toolrestoreUserLevelunlock screenend makeNewHCButtonfunction memErrorScript appName-- returns a script used in many placesreturn "if the result is not empty then" & return & ¬¨"beep 1" & return & ¬¨"answer" && quote & "Not enough memory to open the application ‚Äú" ¬¨& appName & "‚Äù." & quote & return & ¬¨"end if" -- ‚àÜend memErrorScriptfunction writeHCScript fileType,fileName,applName-- Requires handler: memErrorScript-- ‚àÜ creates and writes the script for the new button -- see makeNewHCButtonput "on mouseUp" & return into theScriptif fileType is "stack"  thenput "-- stack will open in new window if there's enough memory" & return ¬¨& "go to stack" && quote & fileName & quote && "in a new window" & return ¬¨& "if the result is" && quote & "Cancel" & quote && "then exit mouseUp" & return ¬¨& "else if the result <> empty then go to stack" && quote & fileName & quote & return after theScriptelse if fileType is "application" thenput "open" && quote & fileName & quote & return after theScriptput memErrorScript(fileName) & return after theScriptelse if fileType is "document" thenput "open" && quote & fileName & quote ¬¨&& "with" && quote & applName & quote & return after theScriptput memErrorScript(applName) & return after theScriptend ifput "end mouseUp" after theScriptreturn theScriptend writeHCScripton dragHCButton theButton-- ‚àÜ let user drag the button within the card windowput "Drag the button to the desired location." -- ‚àÜ-- flash button until user clicks down on itset cursor to arrowrepeat until the mouse is downset hilite of theButton to not hilite of theButtonwait 8 -- 8/60 of a secondend repeatset hilite of theButton to true-- drag the button but constrain to card windowput width of theButton div 2 into halfBtnWidthput width of card window - halfBtnWidth into maxWidthput height of theButton div 2 into halfBtnHeightput height of card window - halfBtnHeight into maxHeightrepeat while the mouse is down-- the horzput max(the mouseH,halfBtnWidth) into btnHput min(btnH,maxWidth) into btnH-- the vertput max(the mouseV,halfBtnHeight) into btnVput min(btnV,maxHeight) into btnVset loc of theButton to btnH,btnVend repeatset hilite of theButton to falseend dragHCButtonon updateHCPaths fileType,thePath-- Requires function handler: stringIsInContainer-- update the appropriate path card for the newly created buttonglobal Stacks,Applications,Documentsput "s" after fileType -- ‚àÜ so it will match card & global namedo "get" && fileType -- put the appropriate global into "it"-- exit this handler if the global already contains the pathif stringIsInContainer(thePath,it) then exit updateHCPathslock screenset cursor to watchset lockmessages to true -- avoid open messagesset lockrecent to true -- don't make any card miniaturespush card -- remember where we are-- go to the correct path card in the home stackgo card fileType of stack "Home" -- ‚àÜ-- update the "Paths" field with the new pathget bg field "Paths" of card fileTypeif (it ‚↠empty) and (the last char of it ‚↠return)then put return before thePathput thePath after bg field "Paths" of card fileType-- cause the appropriate global variable to be updateddo "put bg field Paths into" && fileTypepop card -- return to where we wereend updateHCPathsfunction stringIsInContainer theString,theContainer--  check to see if theString is a full line of theContainerif (theString = first line of theContainer) or ¬¨(theString = last line of theContainer) then return trueelse if theContainer contains return & theString & return ¬¨then return true-- not found, so return falsereturn falseend stringIsInContainer</script>
  368. </background>
  369.